package com.yida.gwj.scene.expend.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yida.common.core.utils.DateUtils;
import com.yida.gwj.scene.expend.domain.GwjSceneExpendBusinessDetail;
import com.yida.gwj.scene.expend.mapper.GwjSceneExpendBusinessDetailMapper;
import com.yida.gwj.scene.expend.service.IGwjSceneExpendBusinessDetailService;

/**
 * 现场支出业务详情Service业务层处理
 * 
 * @author hmh
 * @date 2023-08-14
 */
@Service
public class GwjSceneExpendBusinessDetailServiceImpl implements IGwjSceneExpendBusinessDetailService {
    @Autowired
    private GwjSceneExpendBusinessDetailMapper gwjSceneExpendBusinessDetailMapper;

    /**
     * 查询现场支出业务详情
     * 
     * @param detailId 现场支出业务详情主键
     * @return 现场支出业务详情
     */
    @Override
    public GwjSceneExpendBusinessDetail selectGwjSceneExpendBusinessDetailByDetailId(Long detailId) {
        return gwjSceneExpendBusinessDetailMapper.selectGwjSceneExpendBusinessDetailByDetailId(detailId);
    }

    /**
     * 查询现场支出业务详情列表
     * 
     * @param gwjSceneExpendBusinessDetail 现场支出业务详情
     * @return 现场支出业务详情
     */
    @Override
    public List<GwjSceneExpendBusinessDetail> selectGwjSceneExpendBusinessDetailList(GwjSceneExpendBusinessDetail gwjSceneExpendBusinessDetail) {
        return gwjSceneExpendBusinessDetailMapper.selectGwjSceneExpendBusinessDetailList(gwjSceneExpendBusinessDetail);
    }

    /**
     * 新增现场支出业务详情
     * 
     * @param gwjSceneExpendBusinessDetail 现场支出业务详情
     * @return 结果
     */
    @Override
    public int insertGwjSceneExpendBusinessDetail(GwjSceneExpendBusinessDetail gwjSceneExpendBusinessDetail) {
        gwjSceneExpendBusinessDetail.setCreateTime(DateUtils.getNowDate());
        return gwjSceneExpendBusinessDetailMapper.insertGwjSceneExpendBusinessDetail(gwjSceneExpendBusinessDetail);
    }

    /**
     * 修改现场支出业务详情
     * 
     * @param gwjSceneExpendBusinessDetail 现场支出业务详情
     * @return 结果
     */
    @Override
    public int updateGwjSceneExpendBusinessDetail(GwjSceneExpendBusinessDetail gwjSceneExpendBusinessDetail) {
        gwjSceneExpendBusinessDetail.setUpdateTime(DateUtils.getNowDate());
        return gwjSceneExpendBusinessDetailMapper.updateGwjSceneExpendBusinessDetailByBizId(gwjSceneExpendBusinessDetail);
    }

    /**
     * 批量删除现场支出业务详情
     * 
     * @param detailIds 需要删除的现场支出业务详情主键
     * @return 结果
     */
    @Override
    public int deleteGwjSceneExpendBusinessDetailByDetailIds(Long[] detailIds) {
        return gwjSceneExpendBusinessDetailMapper.deleteGwjSceneExpendBusinessDetailByDetailIds(detailIds);
    }

    /**
     * 删除现场支出业务详情信息
     * 
     * @param detailId 现场支出业务详情主键
     * @return 结果
     */
    @Override
    public int deleteGwjSceneExpendBusinessDetailByDetailId(Long detailId) {
        return gwjSceneExpendBusinessDetailMapper.deleteGwjSceneExpendBusinessDetailByDetailId(detailId);
    }

    /**
     * 查询现场支出业务详情根据业务ID
     * 
     * @param detailId 现场支出业务详情主键
     * @return 现场支出业务详情
     */
    @Override
    public GwjSceneExpendBusinessDetail selectGwjSceneExpendBusinessDetailByBizId(Long bizId) {
        return gwjSceneExpendBusinessDetailMapper.selectGwjSceneExpendBusinessDetailByBizId(bizId);
    }
}
